<?php
/**
 * (海外仓-谷仓)商品
 */

namespace App\Logic\Plat\Rakuten\Overseas\GuCang\Product;


use App\Logic\Plat\Rakuten\Overseas\GuCang\RakutenOverseasClient;
use App\Models\Rakuten\RakutenLogs;

class OverseasProduct{

    const get_product_sku_list = 'public_open/product/get_product_sku_list'; //谷仓产品列表

    /**
     *
     * @param null $productSku
     * @param array $productSkuArr
     * @return mixed
     */
    public static function getProductSkuList($productSku = null, $productSkuArr = []){

        $apiParams = [
            'product_sku' => $productSku, //商品SKU
            'product_sku_arr' => $productSkuArr, //客户SKU(多个SKU)
            'product_update_time_from' => null, //修改开始时间
            'product_update_time_to' => null, //修改结束时间

            'page' => 1,
            'pageSize' => 10
        ];

        $res = RakutenOverseasClient::getRequest(self::get_product_sku_list,$apiParams);
        if ($res->message == 'Success') {
            return $res;
        }else{
            //日志
            RakutenLogs::logs(RakutenLogs::$overseasOrderProductSku,
                json_encode($res,JSON_UNESCAPED_UNICODE),
                json_encode($apiParams,JSON_UNESCAPED_UNICODE)
            );
        }
    }

}
